package com.ruoyi.dl.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dl.mapper.DlProgressMapper;
import com.ruoyi.dl.domain.DlProgress;
import com.ruoyi.dl.service.IDlProgressService;
import com.ruoyi.common.core.text.Convert;

/**
 * 进度上传Service业务层处理
 *
 * @author ruoyi
 * @date 2020-12-28
 */
@Service
public class DlProgressServiceImpl implements IDlProgressService {
    @Autowired
    private DlProgressMapper dlProgressMapper;

    /**
     * 查询进度上传
     *
     * @param id 进度上传ID
     * @return 进度上传
     */
    @Override
    public DlProgress selectDlProgressById(Integer id) {
        return dlProgressMapper.selectDlProgressById(id);
    }

    /**
     * 根据用户id查询进度上传
     *
     * @param userId 进度上传ID
     * @return 进度上传
     */
    @Override
    public DlProgress selectDlProgressByUserId(Integer userId) {
        return dlProgressMapper.selectDlProgressByUserId(userId);
    }

    /**
     * 查询进度上传列表
     *
     * @param dlProgress 进度上传
     * @return 进度上传
     */
    @Override
    public List<DlProgress> selectDlProgressList(DlProgress dlProgress) {
        return dlProgressMapper.selectDlProgressList(dlProgress);
    }

    //关联
    @Override
    public List<DlProgress> newSelectDlProgressList(DlProgress dlProgress) {
        return dlProgressMapper.newSelectDlProgressList(dlProgress);
    }

    /**
     * 新增进度上传
     *
     * @param dlProgress 进度上传
     * @return 结果
     */
    @Override
    public int insertDlProgress(DlProgress dlProgress) {
        dlProgress.setCreateTime(DateUtils.getNowDate());
        return dlProgressMapper.insertDlProgress(dlProgress);
    }

    /**
     * 修改进度上传
     *
     * @param dlProgress 进度上传
     * @return 结果
     */
    @Override
    public int updateDlProgress(DlProgress dlProgress) {
        return dlProgressMapper.updateDlProgress(dlProgress);
    }

    /**
     * 删除进度上传对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDlProgressByIds(String ids) {
        return dlProgressMapper.deleteDlProgressByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除进度上传信息
     *
     * @param id 进度上传ID
     * @return 结果
     */
    @Override
    public int deleteDlProgressById(Integer id) {
        return dlProgressMapper.deleteDlProgressById(id);
    }
}
